<?php /*a:2:{s:58:"/www/wwwroot/www.moxiongdi.com/app/admin/view/cat/add.html";i:1698050634;s:57:"/www/wwwroot/www.moxiongdi.com/app/admin/view/cat/js.html";i:1698050634;}*/ ?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title><?php echo htmlentities($pagetitle); ?></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/admin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/admin/style/global.css" media="all">
</head>
<body>

<form action="<?php echo url(); ?>" class="layui-form" method="post" lay-filter="component-form-element" onsubmit="return save_form2(this)">
	<input type="hidden" name="sort" value="<?php echo htmlentities($sort); ?>">
	<input type="hidden" name="pubid" value="<?php echo htmlentities($pubid); ?>">
	
	<div class="layui-card">
	  <div class="layui-card-body">
		<div class="layui-tab layui-tab-card">
		<ul class="layui-tab-title">
			<li class="layui-this">基本设置</li>
			<li>模板设置</li>
			<li>SEO设置</li>
			<li>权限设置</li>
			<?php if($ModelModel['cat_is_enter']): ?>
                            <li>自定义字段</li>
			<?php endif; ?>
		</ul>
		<div class="layui-tab-content">
		  <div class="layui-tab-item layui-show">

				<div class="layui-form-item">
				  <label class="layui-form-label">栏目模型</label>
				  <div class="layui-input-inline">
                        <select style="width:200px" name="modelid" class="select2" lay-ignore onchange="urlgo(this)">
                            <option value="">请选择栏目模型</option>
                            <?php foreach($modeList as $v): ?>
                                <option value="<?php echo htmlentities($v['modelid']); ?>" <?php echo $copyinfo['modelid']==$v['modelid'] ? 'selected' : ''; ?> <?php echo $modelid==$v['modelid'] ? 'selected' : ''; ?>><?php echo htmlentities($v['name']); ?></option>
                            <?php endforeach; ?>
                        </select>
				  </div>
				</div>
				<div class="layui-form-item">
				  <label class="layui-form-label">父级</label>
				  <div class="layui-input-inline">
					<select style="width:200px" name="pid" class="select2" lay-ignore><option value="">顶级栏目</option><?php echo $cat; ?></select>
				  </div>
				</div>
				<div class="layui-form-item">
				  <label class="layui-form-label">栏目名称</label>
				  <div class="layui-input-inline">
					<input type="text" name='name' autocomplete="off"  class="layui-input">
				  </div>
				</div>		
				<div class="layui-form-item">
				  <label class="layui-form-label">栏目路径<span>仅支持：英文，字母，下划线</span></label>
				  <div class="layui-input-inline">
					<input type="text" name='classpath' value="<?php echo htmlentities($classpath); ?>" autocomplete="off" class="layui-input">
				  </div>
				</div>		
                                <div class="layui-form-item">
                                  <label class="layui-form-label">缩略图<span></span></label>
                                  <div class="layui-input-inline file-upload">
                                                <input type="text" name="thumb" id="info_thumb" value="<?php echo htmlentities($copyinfo['thumb']); ?>" autocomplete="off" class="layui-input"/>
                                                <div class="layui-btn-group">
                                                        <button type="button" class="layui-btn" onclick="previewImg('info_thumb')"><i class="layui-icon">&#xe64a;</i>预览</button>
                                                        <button type="button" class="layui-btn fastupimg" data-input_id="info_thumb" data-listtype="img" id="info_thumb_Picker"><i class="layui-icon">&#xe608;</i>上传</button>
                                                        <button type="button" class="layui-btn" onClick="selectfile('info_thumb','','img')"><i class="layui-icon">&#xe67c;</i>浏览</button>
                                                </div>
                                  </div>
                                </div>	
				<div class="layui-form-item">
				  <label class="layui-form-label">状态</label>
				  <div class="layui-input-inline">
					<input type="checkbox" value="1" name="status" lay-skin="switch" lay-text="启用|禁用"  checked>
				  </div>
				</div>
				  <div class="layui-form-item">
					  <label class="layui-form-label">显示</label>
					  <div class="layui-input-inline">
						  <input type="checkbox" value="1" name="display" lay-skin="switch" lay-text="显示|隐藏"  checked>
					  </div>
				  </div>
				<div class="layui-form-item">
				  <label class="layui-form-label">每页显示</label>
				  <div class="layui-input-inline select">
					<input type="text" name="lencord" value="<?php echo !empty($copyinfo['lencord']) ? htmlentities($copyinfo['lencord']) : 20; ?>"  autocomplete="off" class="layui-input"/>条				
				  </div>
				</div>	                      
				<div class="layui-form-item">
				  <label class="layui-form-label">前台排序方式</label>
				  <div class="layui-input-inline select">
					<input type="text" name="listorder" value="<?php echo !empty($copyinfo['listorder']) ? htmlentities($copyinfo['listorder']) : array_search('默认排序',$orderInc); ?>" autocomplete="off" class="layui-input"/>
					<select onchange="update_order(this,'listorder')" lay-ignore >
						<?php foreach($orderInc as $k=>$v): ?>
							<option value="<?php echo htmlentities($k); ?>"><?php echo htmlentities($v); ?></option>
						<?php endforeach; ?>
					</select>					
				  </div>
				</div>						
				<div class="layui-form-item">
				  <label class="layui-form-label">后台排序方式</label>
				  <div class="layui-input-inline select">
					<input type="text" name="reorder" value="<?php echo !empty($copyinfo['reorder']) ? htmlentities($copyinfo['reorder']) : array_search('默认排序',$orderInc); ?>" autocomplete="off" class="layui-input"/>
					<select onchange="update_order(this,'reorder')" lay-ignore>
						<?php foreach($orderInc as $k=>$v): ?>
							<option value="<?php echo htmlentities($k); ?>"><?php echo htmlentities($v); ?></option>
						<?php endforeach; ?>
					</select>	
				  </div>
				</div>									
		  </div>
		  <div class="layui-tab-item">

				<div class="layui-form-item">
				  <label class="layui-form-label">列表模板</label>
				  <div class="layui-input-inline">
                        <select name="listtemp" class="layui-input">
                            <option value="">请选择列表模板</option>
                            <?php foreach($listtemp as $v): ?>
                                <option value="<?=$v['template_id']?>" <?=$v['template_id']==$copyinfo['listtemp']?'selected':''?>><?=$v['name']?></option>
                            <?php endforeach; ?>
                        </select>
				  </div>
				</div>

				<div class="layui-form-item">
				  <label class="layui-form-label">内容模板</label>
				  <div class="layui-input-inline">
                        <select name="viewtemp" class="layui-input">
                            <option value="">请选择内容模板</option>
                            <?php foreach($viewtemp as $v): ?>
                                <option value="<?=$v['template_id']?>" <?=$v['template_id']==$copyinfo['viewtemp']?'selected':''?>><?=$v['name']?></option>
                            <?php endforeach; ?>
                        </select>
				  </div>
				</div>		
				  
			  
		  </div>
		  <div class="layui-tab-item">

				<div class="layui-form-item">
				  <label class="layui-form-label">SEO标题</label>
				  <div class="layui-input-inline">
					<input type="text"  name='pagetitle' placeholder="不填写默认调用标题" autocomplete="off" class="layui-input">
				  </div>
				</div>	
				<div class="layui-form-item">
				  <label class="layui-form-label">SEO关键字</label>
				  <div class="layui-input-inline">
					<input type="text"  name='keywords' placeholder="多个用半角的逗号隔开" autocomplete="off" class="layui-input">
				  </div>
				</div>	
				<div class="layui-form-item">
				  <label class="layui-form-label">SEO描述信息</label>
				  <div class="layui-input-inline">
					<textarea name='description' autocomplete="off" style="height: 200px;" class="layui-input"></textarea>
				  </div>
				</div>	

		  </div>
		  <div class="layui-tab-item">
			<div class="layui-form-item">
			  <label class="layui-form-label">角色权限</label>
			  <div class="layui-input-inline">


				<div class="widget-content nopadding" style="width:99%; ">
				  <table class="layui-table" style="border-right:1px solid #ccc">
					<thead>
					  <tr>
						<th style="width:5%">角色名称</th>              
						<th style="width:6%;cursor:pointer;text-decoration: underline" class="thischeck_all" val="1" objname="info_view">查看权限</th>
						<th style="width:6%;cursor:pointer;text-decoration: underline" class="thischeck_all" val="1" objname="info_add">增加权限</th>
						<th style="width:6%;cursor:pointer;text-decoration: underline" class="thischeck_all" val="1" objname="info_editor">编辑权限</th>
						<th style="width:6%;cursor:pointer;text-decoration: underline" class="thischeck_all" val="1" objname="info_delete">删除权限</th>
						<th style="width:6%;cursor:pointer; text-decoration: underline" class="thischeck_all" val="1" objname="info_checked">审核权限</th>
					  </tr>
					</thead>
					<tbody>
						<?php foreach($roleInc as $v): ?>
							<tr>
								<td style="text-align: center;"><?php echo htmlentities($v['name']); ?></td>                                                             
								<td class="center"><input type="checkbox" lay-ignore name="view_role_<?php echo htmlentities($v['id']); ?>" class="info_view" value="1" checked=""/></td>
								<td class="center"><input type="checkbox" lay-ignore name="add_role_<?php echo htmlentities($v['id']); ?>" class="info_add" value="1" checked=""/></td>
								<td class="center"><input type="checkbox" lay-ignore name="editor_role_<?php echo htmlentities($v['id']); ?>" class="info_editor" value="1" checked=""/></td>
								<td class="center"><input type="checkbox" lay-ignore name="delete_role_<?php echo htmlentities($v['id']); ?>" class="info_delete" value="1" checked=""/></td>
								<td class="center"><input type="checkbox" lay-ignore name="checked_role_<?php echo htmlentities($v['id']); ?>" class="info_checked" value="1" checked=""/></td>
							</tr>
						<?php endforeach; ?>

					</tbody>
				  </table>
				</div>


			  </div>
			</div>	
					
				<div class="layui-form-item">
				  <label class="layui-form-label">会员组权限</label>
				  <div class="layui-input-inline">
                        <select style="width:500px" name="member_group_id[]" multiple="true" placeholder="可针对指定会员组访问" class="select2" lay-ignore>
                            <?php foreach($memberGroupInc as $v): ?>
                                <option value="<?php echo htmlentities($v['group_id']); ?>"><?php echo htmlentities($v['name']); ?></option>
                            <?php endforeach; ?>
                        </select>（不勾选则针对所有人开放）
				  </div>
				</div>							  
						  
		  </div>
		  <?php if($ModelModel['cat_is_enter']): ?>
			<div class="layui-tab-item"><?=think\facade\View::fetch($CatFormTemp)?></div>
		  <?php endif; ?>
		</div>
	  </div>
	</div>	
	<div class="layui-form-item layui-layout-admin" style="margin-top: 30px;">
		<div class="layui-input-block">
		   <div class="layui-footer" style="left: 0;">
			  <button class="layui-btn" type="submit"  lay-filter="component-form-element">立即提交</button>
			  <button type="reset" class="layui-btn layui-btn-primary close">关闭</button>
		  </div>
		</div>
	</div>  
</form>
  <!--文件上传ajax调用的接口地址-->
  <script>
    var upload_index="<?php echo url('file/index'); ?>";
    var upload_add="<?php echo url('file/add'); ?>";
    var upload_config="<?php echo url('file/uploadConfig'); ?>";
  </script>

<!--公共必要的JS-->
<script src="/static/admin/layui/layui.js"></script>
<script src="/static/js/jquery.min.js"></script>    
<script src="/static/js/globals.js"></script> 
  
<!--编辑器开始-->
<script>
  //这里是用于配置编辑器里调用文件管理器的变量
  var ueditor_serverUrl="<?php echo url('File/ueditorImg'); ?>?pubid="+$("input[name='pubid']").val()
</script>
<script src="/static/ueditor/ueditor.config.js"></script> 
<script src="/static/ueditor/ueditor.all.js"></script> 
<script>
    $(function () {
        //循环实例化编辑器
        $(".news_editor").each(function(){
            var editor_name=$(this).attr("editor_name");
            var editor_width=$(this).attr("editor_width");
            var editor_height=$(this).attr("editor_height");
            var imgwidth=$(this).attr("imgwidth");
            var imgheight=$(this).attr("imgheight");
            var ue = UE.getEditor(editor_name, {
				zIndex:1,
                initialFrameHeight: editor_height>0?editor_height:"0",
                initialFrameWidth: editor_width>0?editor_width:'100%',
                imgwidth: imgwidth,
                imgheight: imgheight,
            });
            //启用抓取微信文章功能
            if(editor_name=="newstext"){
                $(".subWxCrawler").show();
            }
        })

    })
</script>  
<!--编辑器结束-->  
<!---百度地图--->
<script type="text/javascript" src="/static/baidumap/setpoint.js"></script>
<script>
    $(".baidu_map_field").each(function(){
        var baidu_map=new baidumap();
        baidu_map.map_search_value_id=$(this).find(".map_search_value").attr("id");
        baidu_map.map_search_button_id=$(this).find(".map_search_button").attr("id");
        baidu_map.map_field_id=$(this).find(".map_point").attr("id"); 
        baidu_map.map_show_id=$(this).find(".map_show").attr("id");         
        baidu_map.showPoint=0;//如果修改信息的话需要显示之前的标记，这里请设置1  增加信息设置0        
        //启动地图显示区方法
        baidu_map.newmap();        
        //启动地址模糊搜索方法
        baidu_map.map_search();
        //启动鼠标点击拾取坐标方法
        baidu_map.map_position();        
    })
</script>
  
<!--文件上传 start-->
<script type="text/javascript" src="/static/webuploader/kinderfile.js"></script>
<script type="text/javascript" src="/static/webuploader/Sortable.js"></script>    
<script type="text/javascript" src="/static/webuploader/morepic.js"></script>   


<!--以下是针对 快速上传单个文件插件-->  
<link rel="stylesheet" type="text/css" href="/static/webuploader/style/webuploader.css" />
<link rel="stylesheet" type="text/css" href="/static/webuploader/style/style.css" />
<script type="text/javascript" src="/static/webuploader/webuploader.js"></script>
<script type="text/javascript" src="/static/webuploader/fastupimg.js"></script>
<!--文件上传 end-->
<!--文件上传的预览功能中中也需要用到我 fancybox plus start-->
<link rel="stylesheet" type="text/css" href="/static/fancybox3/jquery.fancybox.min.css" media="screen" />	
<script type="text/javascript" src="/static/fancybox3/jquery.fancybox.min.js"></script>
<!--文件上传的预览功能中中也需要用到我 fancybox plus end-->


  <!--select2 js start-->
  <link rel="stylesheet" href="/static/select2/select2.css" media="all">
  <script src="/static/select2/select2.js"></script>
  <!--select2 js end-->
<script>
    $(function(){
        $(".thischeck_all").click(function(){
            var y=$(this).attr("val");
            var objname=$(this).attr("objname");
            if(y==0){
                $("."+objname).prop("checked", false);
                y=1;
            }else if(y==1){
                $("."+objname).prop("checked", true);
                y=0;
            }
            $(this).attr("val",y);
        })
    })

    //排序
    function update_order(obj,inputname){
        $("input[name='"+inputname+"']").val($(obj).val());
    }
//layer
  layui.config({
    base: '/static/admin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form', 'laydate'], function(){
    var $ = layui.$
	,laydate = layui.laydate
    ,form = layui.form;
	//时间控件
	$(".form-date").each(function(){
		var dataFormat=$(this).data("format");
		dataFormat=dataFormat?dataFormat:"yyy-MM-dd";
		laydate.render({
		  elem:this,
		  calendar: true,
		  format: dataFormat //可任意组合
		});
	});

	$('.select2').select2();
  })
//模型切换
function urlgo(obj){
  $val=$(obj).val();
  window.location.href='<?php echo url(); ?>?catid=<?php echo htmlentities($catid); ?>&pid=<?php echo htmlentities($pid); ?>&modelid='+$val;
}
//多值字段
function morevalue_add(obj,str){
	str=str.replace(/randImgId/g, "img_"+randStr());
	str=str.replace(/randFileId/g, "file_"+randStr());
	str=str.replace(/randVideoId/g, "video_"+randStr());
	$(obj).parents("tr").after(str);
}
function morevalue_del(obj){
	var len=$(obj).parents("tbody").children().length;
	if(len==1){
		alert("至少要保留一行数据");
		return false;
	}
	$(obj).parents("tr").remove();
}
  </script>
<!--tiny编辑器开始-->
<script src="/static/tinymce/tinymce.min.js"></script>
<script src="/static/tinymce/tinymce.config.js"></script>
<!--tiny编辑器结束-->

</body>
</html>